package org.nbict.iot.trident.influx.state;

import org.apache.storm.task.IMetricsContext;
import org.apache.storm.trident.state.State;
import org.apache.storm.trident.state.StateFactory;
import org.nbict.iot.trident.influx.mapper.InfluxdbMapper;

import java.util.Map;

/**
 * Created by songseven on 18/7/3.
 */
public class InfluxdbStateFactory implements StateFactory {

    private InfluxdbMapper mapper;

    public InfluxdbStateFactory(InfluxdbMapper mapper) {
        this.mapper = mapper;
    }

    @Override
    public State makeState(Map conf, IMetricsContext metrics, int partitionIndex, int numPartitions) {
        InfluxdbState state = new InfluxdbState(mapper);
        return state;
    }
}
